package cn.rulian.base.auth.bo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.rulian.base.common.bo.BaseBo;

import com.fasterxml.jackson.annotation.JsonFormat;


/** 
 * Description: 机构
 */

@Entity
@Table(name = "base_auth_organ")
public class Organ extends BaseBo{
	
	@ManyToOne
	@JoinColumn(name = "father_id")
	private Organ father; //父机构
	
	@Column(length = 10)
	private String code; //编号
	
	@Column(length = 50)
	private String allCode; //全编号
	
	@Column(length = 50)
	private String name; //名称
	
	private Integer orderNum; //排序号
	
	private Boolean locked; //是否锁定。锁定后不允许编辑删除，防止误操作。
	
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 
	private Date addTime; //增加时间
	
	@Transient
	private Long _parentId;

	
	public Organ getFather()
	{
		return father;
	}

	public void setFather(Organ father)
	{
		this.father = father;
	}

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public Integer getOrderNum()
	{
		return orderNum;
	}

	public void setOrderNum(Integer orderNum)
	{
		this.orderNum = orderNum;
	}

	public Boolean getLocked()
	{
		return locked;
	}

	public void setLocked(Boolean locked)
	{
		this.locked = locked;
	}

	public Date getAddTime()
	{
		return addTime;
	}

	public void setAddTime(Date addTime)
	{
		this.addTime = addTime;
	}

	public Long get_parentId()
	{
		return _parentId;
	}

	public void set_parentId(Long _parentId)
	{
		this._parentId = _parentId;
	}

	public String getAllCode()
	{
		return allCode;
	}

	public void setAllCode(String allCode)
	{
		this.allCode = allCode;
	}
	
}